how to find frequency of given character